package cm.day08;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Test3 {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
      list.add(12);
      list.add(17);
      list.add(18);
      list.add(15);
      list.add(13);
        //打乱顺序
        Collections.shuffle(list);
        System.out.println(list);
        //升序排序
        Collections.sort(list);
        System.out.println(list);
        //降序
        Collections.sort(list, (num1,num2)-> num2-num1);
        System.out.println(list);
    }
}
